<template>
	<view class="classLayout pageBG">
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="classify">
			<theme-item v-for="item in classifyList" :key="item._id" :item="item"></theme-item>
		</view>
	</view>
	
</template>

<script setup>
	import {ref} from 'vue';
	import {apiGetClassify} from '@/api/apis.js'
	import {onShareAppMessage,onShareTimeline} from '@dcloudio/uni-app'
	const classifyList = ref([]);
	
	const getClassifyList = async()=>{
		let res = await apiGetClassify({
			pageSize:15
		});
		classifyList.value = res.data;
	}
	getClassifyList();
	onShareAppMessage((e)=>{
		return{
			title:'壁壁生笙，精选分类',
			path:"/pages/classify/classify"
		}
	})
	
	onShareTimeline((e)=>{
		return{
			title:'壁壁生笙，精选分类',
			imageUrl:classifyList.value[1].picurl
		}
	})
	
</script>

<style lang="scss" scoped>
	.classify{
		padding: 30rpx;
		display: grid;
		grid-template-columns: repeat(3,1fr);
		gap: 15rpx;
		
	}
</style>
